package com.example.demo.controller;

import com.example.demo.service.WorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.LinkedHashMap;
import java.util.List;

@RestController
@RequestMapping("/work")
public class WorkController {

    @Autowired
    private WorkService workService;

    @GetMapping("/projectHours")
    public List<LinkedHashMap<String, Object>> getProjectWorkHours(
            @RequestParam String projectId,
            @RequestParam String startDate,
            @RequestParam String endDate) {
        return workService.getProjectWorkHours(projectId, startDate, endDate);
    }
}